package br.com.gaacorp.sai.model;

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

@Entity
@Table(name = "tab_course")
public class Course extends BaseObject implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 5312740521991245089L;
	private Long courseId;
	private String name;
	private String description;

	public boolean equals(Object o) {
		if (this == o) {
			return true;
		}
		if (!(o instanceof Course)) {
			return false;
		}

		final Course course = (Course) o;

		return !(name != null ? !name.equals(course.name) : course.name != null);
	}

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	public Long getCourseId() {
		return courseId;
	}

	public String getDescription() {
		return description;
	}

	public String getName() {
		return name;
	}

	public int hashCode() {
		return (name != null ? name.hashCode() : 0);
	}

	public void setCourseId(Long courseId) {
		this.courseId = courseId;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String toString() {
		return new ToStringBuilder(this, ToStringStyle.SIMPLE_STYLE).append(
				this.name).toString();
	}

}
